/*
 * Copyright 2011 Alex Paréj.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.mkdir.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Alex Paréj
 */
@Entity
@Table(name = "RENDSZER_BEALLITASOK")
public class RendszerBeallitas extends AbstractEntitiy<String> implements Serializable {

    public final static String ALAPERTELMEZETT_TARHELY = "alapertelmezett tarhely";
    public final static String RENDSZER_TARHELY = "rendszer tarhely";
    public final static String INAKTIVITAS_IDOKORLAT = "inaktivitas idokorlat";
    public final static String INFO_ABLAK_MEGJELENITESENEK_HOSSZA = "info ablak megjelenitesenek hossza";
    public final static String ALAPERTELMEZETT_TEMA = "alapertelmezettt tema";
    private static final long serialVersionUID = 1L;
    @Id
    @Size(max = 255)
    @Column(name = "NEV")
    private String nev;
    @Basic(optional = false)
    @NotNull
    @Size(max = 255)
    @Column(name = "ERTEK")
    private String ertek;
    @JoinColumn(name = "MODOSITO")
    @ManyToOne
    private Felhasznalo modosito;
    @Column(name = "MODOSITVA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date modositva;

    public RendszerBeallitas() {
    }

    public String getErtek() {
        return ertek;
    }

    public void setErtek(String ertek) {
        this.ertek = ertek;
    }

    public Felhasznalo getModosito() {
        return modosito;
    }

    public void setModosito(Felhasznalo modosito) {
        this.modosito = modosito;
    }

    public Date getModositva() {
        return modositva;
    }

    public void setModositva(Date modositva) {
        this.modositva = modositva;
    }

    public String getNev() {
        return nev;
    }

    public void setNev(String nev) {
        this.nev = nev;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nev != null ? nev.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RendszerBeallitas)) {
            return false;
        }
        RendszerBeallitas other = (RendszerBeallitas) object;
        if ((this.nev == null && other.nev != null) || (this.nev != null && !this.nev.equals(other.nev))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mkdir.model.RendszerBeallitas[ nev=" + nev + " ]";
    }

    @Override
    public String getId() {
        return nev;
    }

    @Override
    public void setId(String id) {
        this.nev = id;
    }
}
